using System;
using System.Collections.Generic;

namespace Quiki.Querying
{
    public class Query
    {
        public Query(IQuerySpecification specification)
        {
            this.specification = specification;
        }

        public IQuerySpecification Specification
        {
            get { return specification; }
        }

        public IEnumerable<WikiDocument> Run(DocumentGraph documents)
        {
            return specification.Filter(documents.ListDocuments());
        }

        private IQuerySpecification specification;
    }
}